package model

import (
	"time"
)

type Region struct {
	RegionId int64 `xorm:"pk autoincr"`
	RegionName string
	CheckNodeLsit *[]CheckNode `xorm:"-"`
	CreatedAt time.Time
  	UpdatedAt time.Time
}

func (r *Region)DeleteRegion(regionId int64) (map[string]interface{}, error){
	var p *Paper

	if len(p.QueryRegionPaper(regionId)) > 0{
		return map[string]interface{}{"message": "该区域存在未审核订单","code":"400"}, nil
	}

	var region Region
	x.Id(regionId).Delete(&region)
	return map[string]interface{}{"message": "成功","code":"200"}, nil
}

